package grame

/**
 * @author Shining Wang <shiningwang@topca.com>
 */
@SuppressWarnings("GroovyUnusedDeclaration")
class Menu {
    String id = UUID.randomUUID().toString()
    String name
    Date dateCreated
    Date lastUpdated
    String target   //动作  grails:controllers:$controllerName:$actionName
    int index
    int level
    Menu preMenu  // previous menu
    SortedSet subMenus
    static hasMany = [subMenus: Menu]
    static belongsTo = [Menu]

    static constraints = {
        id shared: 'id', bindable: true
        name shared: 'name', nullable: false, blank: false
        level range: 1..10
        subMenus lazy: false
    }
}
